<template>
	<view>
		<view class="" :style="'height: '+statusBarHeight+'px;background:#fff;'"></view>
		<view class="infotop">{{$t('tabbar.message')}}</view>
		<scroll-view scroll-y="true" :style="'height:'+scrollheight+'px;'">
			<view class="infolist">
				<view class="infolist_main" v-for="(item,index) in list"
					@click="$fun.jump(`./details?id=${item.id}&type=${type}&name=${$t('information.name1')}`)">
					<image :src="$fun.imgUrl(item.image)" mode=""></image>
					<view class="right">
						<view class="name"><u--text color='#333333' size="16" :lines='1' :text="item.title"></u--text>
						</view>
						<view class="ntext">
							<u--text color='#666666' size="13" :lines='2' :text="item.title"></u--text>
							<!-- <rich-text class="richtext" :nodes="item.content"></rich-text> -->
						</view>
						<view class="right_bot">
							<image :src="$fun.imgUrl(item.logo)" mode=""></image>
							<view class="text">{{item.author}}</view>
							<view class="time">{{item.createtime}}</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
		<TabBar :tabBarShow="2"></TabBar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				scrollheight: 0,
				statusBarHeight: 0,
				list: [],
				type: 2
			}
		},
		onLoad() {
			uni.hideTabBar()
			const phoneInfo = uni.getSystemInfoSync(); // 获取手机系统信息
			this.statusBarHeight = phoneInfo.statusBarHeight
			this.scrollheight = uni.getWindowInfo().windowHeight - 118
			this.$fun.ajax.post('news/index', {
				type: 2
			}).then(res => {
				this.list = res.data;
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	page {
		background: #F5F1EE;
	}

	.richtext {

		::v-deep .MsoNormal,
		::v-deep .MsoNormal span,
		::v-deep span {
			font-size: 26rpx !important;
		}
	}

	.infotop {
		width: 750rpx;
		height: 88rpx;
		line-height: 88rpx;
		text-align: center;
		background: #ffffff;
		border-radius: 1rpx;
		font-weight: 600;
		font-size: 36rpx;
		color: #19181A;
	}

	.infolist {
		padding-bottom: 30rpx;

		&_main {
			width: 690rpx;
			height: 240rpx;
			background: #FFFFFF;
			border-radius: 24rpx;
			display: flex;
			margin: 30rpx auto 0;
			padding: 20rpx;
			box-sizing: border-box;

			image {
				width: 200rpx;
				height: 200rpx;
				border-radius: 16rpx;
				margin-right: 16rpx;
				border: 1rpx solid #F5F1EE;
			}

			.right {
				.name {
					font-weight: 500;
					font-size: 32rpx;
					color: #333333;
					width: 434rpx;
					display: flex;
					line-height: 32rpx;
					overflow: hidden;
					flex-wrap: nowrap;
					text-overflow: ellipsis;
				}

				.ntext {
					font-weight: 400;
					font-size: 26rpx;
					color: #666666;
					margin: 10rpx 0 20rpx;
					width: 434rpx;
					height: 74rpx;
					overflow: hidden;
					flex-wrap: nowrap;
					text-overflow: ellipsis;
				}

				&_bot {
					font-weight: 500;
					font-size: 24rpx;
					color: #333333;
					display: flex;
					align-items: center;

					image {
						width: 40rpx;
						height: 40rpx;
						border-radius: 50%;
						margin-right: 10rpx;
						border: 1rpx solid #F5F1EE;
					}

					.time {
						font-weight: 400;
						font-size: 24rpx;
						color: #999999;
						margin-left: 10rpx;
					}
				}
			}
		}
	}
</style>